<?php
	require_once('../session.inc');
	require_once('../class/SanPhamDAO.php');
	if (isset($_REQUEST['maSanPham']) && isset($_REQUEST['soLuong']) && isset($_REQUEST['t']))
	{
			//bắt đầu cập nhật giỏ hàng
			$sanPhamDto = SanPhamDAO::LaySanPhamTheoMa($_REQUEST['maSanPham'], 0);
			$soLuong = $_REQUEST['soLuong'];
			$funcLuuCapNhat ="funcLuuThayDoiGioHang('".$sanPhamDto->Ma."','1')";
			$funcHuy ="funcLuuThayDoiGioHang('".$sanPhamDto->Ma."','0')";
			echo '<td>'.$sanPhamDto->TenSanPham.'</td>
					<td>
						<input name="txtSoLuongSP_Moi" size="5" id="txtSoLuongSP_Moi_'.$sanPhamDto->Ma.'" type="text" value="'.$soLuong.'">
						<input name="hidSoLuongSP" id = "hidSoLuongSP_'.$sanPhamDto->Ma.'" type="hidden" value="'.$soLuong.'">
					</td>
					<td>
						<input name="btnLuu" type="button" onClick='.$funcLuuCapNhat.' value="Lưu">
					</td>
					<td>
						<input name="btnLuu" type="button" onClick='.$funcHuy.' value="Hủy">			
					</td>';
		
	}
?>